package com.example.module_home.Interface;

import com.example.module_home.Entity.CodeInfo;
import com.example.module_home.Entity.CodeTree;
import com.example.module_home.Entity.SearchInfo;
import com.example.module_home.Entity.UserOperationInfo;
import com.example.module_home.Public.Constant;

import java.util.List;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by Administrator on 2018/4/24 0024.
 */

public interface IHomeServer {

    /**
     * 获取登陆用户信息
     */
    @FormUrlEncoded
    @POST(Constant.LOGIN_ACCOUNT)
    Call<String> getLoginUserInfo(@Field("User")String user,@Field("Password")String password);

    /**
     * 获取最近操作信息
     */
    @FormUrlEncoded
    @POST(Constant.GET_ALL_OPERATION)
    Call<List<UserOperationInfo>> getAllOperation(@Field("User")String user, @Field("Password")String password);

    /**
     * 获取文章具体内容
     */
    @GET(Constant.GET_CODE)
    Call<CodeInfo> getCodeInfo(@Query("User")String user, @Query("Password")String password,
                               @Query("kindID")int codeId);

    /**
     * 获取代码库树状图
     */
    @GET(Constant.GET_TREE)
    Call<List<CodeTree>> getCodeTree(@Query("User")String user, @Query("Password")String password);

    /**
     * 获取搜索内容
     */
    @GET(Constant.SEARCH_TITLE)
    Call<List<SearchInfo>> getSearchInfo(@Query("User")String user, @Query("Password")String password,
                                         @Query("title")String title,@Query("typeSelect")String typeSelect);
}

